package ACWing.WeeklyRace;
//4795. 安全区域

import java.util.Scanner;

/**
 * @author :chenjie
 * @date :Created 2023/1/14 19:20
 */
public class SafetyZone {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        long sum=(long) n*n;
        int h=0,l=0;
        int m=sc.nextInt();
        boolean[]st=new boolean[n+1];
        boolean[]st2=new boolean[n+1];
        for (int i = 0; i < m; i++) {
            int a=sc.nextInt();
            int b=sc.nextInt();
            if(st[a]==true&&st2[b]==true){
                System.out.print(sum+" ");
                continue;
            }else {
                if(st[a]==false&&st2[b]==false){
                    sum=sum-((long) (2*n))+1+h+l;
                    st2[b]=true;
                    h++;
                    l++;
                    st[a]=true;
                    System.out.print(sum+" ");
                    continue;
                }
                if(st[a]==true&&st2[b]==false){
                    sum=sum-n+h;
                    st2[b]=true;
                    l++;
                    System.out.print(sum+" ");
                    continue;
                }
                if(st[a]==false&&st2[b]==true){
                    sum=sum-n+l;
                    st[a]=true;
                    h++;
                    System.out.print(sum+" ");
                    continue;
                }
            }
        }
    }
}
